package com.sicheng.lc.lc笔试.阿里篇;

import java.util.HashMap;
import java.util.Scanner;

/**
 * @author zsc
 * @version 1.0
 * @date 2022/4/28 19:59
 */
public class 陡峭峰 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] nums = new int[n];
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            nums[i] = scanner.nextInt();
            map.put(nums[i], map.getOrDefault(nums[i], 0) + 1);
        }
        if (n <= 3) {
            System.out.println(0);
            return;
        }

        if (map.size() <= 3) {
            System.out.println(0);
            return;
        }
    }
}
